package com.ahui.test;

import com.athui.enums.DataRegularEnums;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.operators.DataSource;
import org.apache.flink.api.java.operators.FlatMapOperator;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.util.Collector;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.regex.Matcher;

/**
 * @description: TODO
 * @autor: zhangzhonghui
 * @create: 2024-07-31 21:59
 * @Version: 1.0
 */
public class WordCount {
    public static void main(String[] args) throws Exception {

        String[] testStrings = {"123", "-123", "+123", "123.456", "-123.456", "+123.456", ".456", "-.456", "+.456", "123.", "abc", "", "123.456.789"};

        for (String s : testStrings) {
            Matcher matcher = DataRegularEnums.NUMERICAL_IS_NUMERICAL.getValue().matcher(s);

            if (matcher.matches()){
                System.out.println(s + ": " + Double.valueOf(s));
            }

        }
    }
}
